package cn.zd.dao;

import cn.zd.pojo.ForeignExchangeEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhangdong
 * @version 1.0.0
 * <p>
 */
@Repository public interface ForeignExchangeMapper {

    @Insert("insert into foreign_exchange(id,title,startPrice,minUnit,gangGan,createAt)"
        + " values(#{id},#{title},#{startPrice},#{minUnit},#{gangGan},#{createAt})") void insert(
        ForeignExchangeEntity foreignExchange);

    @Delete("delete from foreign_exchange") void deleteAll();

    @Select("select * from foreign_exchange") List<ForeignExchangeEntity> queryAll();

    @Select("select * from foreign_exchange limit 40") List<ForeignExchangeEntity> query4();

    @Select("select * from foreign_exchange where title = #{title} limit 10") List<ForeignExchangeEntity> queryLikeTitle(
        String title);
}
